﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace posttracker.Classes
{
    public static class Extensions
    {
        public static void CheckString(this User user, params object[] parametrs)
        {
            string concat = "";
            foreach(Object obj in parametrs)
            {
                if (obj is String)
                {
                    concat += obj.ToString();
                }
                else
                {
                    throw new ArgumentException("All provided parametrs must be string.");
                }

            }
 
        }

        public static Int32 ToInt32(this String str)
        {
            Int32 response;
            if (!Int32.TryParse(str, out response))
            {
                throw new ArgumentException("Provided parametr could not be connverted to Int32");
            }

            return response;

        }
    }
}